<template>
	<!-- 医生简介 -->
	<view>
		<view class="card">
			<image :src="doctorObj.image ?doctorObj.image:'../../static/img/user.png'" mode=""></image>
			<view style="margin-top: 80rpx;">
				<view>
					<text class="card_name">{{ doctorObj.name }}</text>
					<text class="card_sub">{{ doctorObj.professionalTitle + '·'+doctorObj.department }}</text>
				</view>
				
				<view class="card_tag">
					<u-tag v-if="doctorObj.level" size="mini" :text="doctorObj.level" plain shape="square" color="#FFFFFF"
						bgColor="#00B4C7" border-color="#00B4C7"></u-tag>
					<text class="card_sub">{{ doctorObj.hospital }}</text>
				</view>
				<!-- 坐诊时间 -->
				<view v-if="doctorObj.settingTimeStart" class="doc_card_right_v ">
					<text class="desc"><text>坐诊时间：</text>{{ doctorObj.settingTimeStart}}</text>
				</view>
				<!-- 擅长 -->
				<view v-if="doctorObj.specialty" class="doc_card_right_v ">
					<text class="desc"><text>擅长：</text>{{ doctorObj.specialty }}</text>
				</view>
				<!-- 简介 -->
				<view class="doc_card_right_v ">
					<text class="desc"><text>简介：</text>{{ doctorObj.details }}</text>
				</view>

			</view>
		</view>
		<u-modal :show="showModel" :title="title" @confirm="confirm" showCancelButton="true" @cancel="showModel = false"
			confirmColor="#00B4C7" cancelColor="#999" ref="uModal">
			<view class="slot-content">
				确定拜{{ doctorObj.name }}为师吗?
			</view>
		</u-modal>
		<view class="bsbtn">
			<u-button @click="handleClick" shape="square" :custom-style="BtnCS">拜师</u-button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				doctorObj: {},
				title: '确定拜师',
				showModel: false,
				BtnCS: {
					height: "80rpx",
					borderRadius: "40rpx",
					color: "#fff",
					backgroundColor: "#00B4C7",
					fontSize: "28rpx"
				}
			}
		},
		onLoad(option) {
			this.doctorObj = option.doctorObj && JSON.parse(option.doctorObj)
			console.log(this.doctorObj)
		},
		methods: {
			handleClick() {
				this.showModel = true
			},
			// 确认拜师
			confirm() {
				this.showModel = false;
			},
		}
	}
</script>

<style scoped lang="scss">
	.card {
		width: 84%;
		margin: 80rpx auto;
		position: relative;

		image {
			width: 112rpx;
			height: 112rpx;
			position: absolute;
			top: -40rpx;
			left: 50rpx;
		}

		.card_name {
			color: #333;
			font-size: 34rpx;
		}

		.card_sub {
			color: #333;
			font-size: 28rpx;
			margin-left: 20rpx;
		}

		.card_tag {
			display: flex;
			align-items: center;
			margin: 10rpx 0;
		}

		.card_desc {
			color: #ccc;
			font-size: 28rpx;
		}
	}

	.bsbtn {
		position: relative;
		/* bottom: 50rpx; */
		margin-bottom: 50rpx;
		margin-top: -50rpx;
		padding-bottom: 50rpx;
		width: 90%;
		margin-left: 5%;
	}

	.desc {
		font-family: PingFangSC;
		color: #999999;
		font-weight: 400;
		font-size: 28rpx;
		font-style: normal;
		text-decoration: none;
		text-align: left;
		text{
			font-weight: 700;
			font-size: 28rpx;
		}
	}
</style>